//==============================================================================
//
// Title:       CC_Barcode_Reader.h
// Purpose:     A short description of the interface.
//
// Created on:  2009-8-8 at 10:59:27 by JXF.
// Copyright:   SUDA. All Rights Reserved.
//
//==============================================================================

#ifndef __CC_BARCODE_READER_H__
#define __CC_BARCODE_READER_H__

#ifdef __cplusplus
    extern "C" {
#endif

//==============================================================================
// Include files

#include "cvidef.h"
#include <rs232.h>

#include "CC_RS232.h"		
		
//==============================================================================
// Constants
#define CC_BCR_OK	0
#define CC_BCR_NG	-1		
#define CC_BCR_NO_READ	-2
		
//==============================================================================
// Types

//==============================================================================
// External variables

//==============================================================================
// Global functions
int  __declspec(dllexport)__stdcall CC_Barcode_Reader_Init(CC_RS232_INFO *Interface, 
	int Port, char *StrPort, 
	int BaudRate, int Parity, int DataBits, int StopBits, 
	int InputBufferLength, int OutputBufferLength, 
	double TimeOut, double DelayBetweenCommands, double DelayRead,
	char WriteEnd[3], char ReadEnd);
int __declspec(dllexport)__stdcall CC_Barcode_Reader_Close(CC_RS232_INFO Interface);

int __declspec(dllexport)__stdcall CC_Barcode_Reader_Scan_And_Read_Process(CC_RS232_INFO Interface, char *ScanCommand, double MaxWaitTime, char* NoReadStr, char *Barcode, int MaxBarcodeLength);
int __declspec(dllexport)__stdcall CC_Barcode_Reader_Scan_Process(CC_RS232_INFO Interface, char *ScanCommand);
int __declspec(dllexport)__stdcall CC_Barcode_Reader_Read_Process(CC_RS232_INFO Interface, double MaxWaitTime, char* NoReadStr, char *Barcode, int MaxBarcodeLength);
int __declspec(dllexport)__stdcall CC_Barcode_Reader_Read_Without_Wait_Process(CC_RS232_INFO Interface, char *NoReadStr, char *Barcode, int MaxBarcodeLength);

int __declspec(dllexport)__stdcall CC_Barcode_Reader_Create_Callback_Process(CC_RS232_INFO Interface, ComCallbackPtr callbackPtr);

#ifdef __cplusplus
    }
#endif

#endif  /* ndef __CC_BARCODE_READER_H__ */
